package com.leetcode.LC;

public class LC204 {
    public int countPrimes(int n) {
        int count = 0;
        for (int i = 2; i < n; i++) {
            if (primeNumber(i)){
                System.out.print(i+",");
                count++;
            }
        }
        System.out.println();
        return count;
    }

    public boolean primeNumber(int n) {

        for (int i = 2; i <= Math.sqrt(n); i++) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {

        System.out.println(new LC204().countPrimes(10));
    }
}
